import axios from 'axios'
import qs from "qs"
import crypto from 'crypto'
import md5String from 'crypto-js/md5'
import router from './../router'
var a = new Date();
var btime = a.getTime();
import { MessageBox } from 'mint-ui';
import {requestPort} from 'pack';
import { getOpenId } from "../methods/baseinfo"
//生产环境服务器
// let objport = "api/server";
// 本地测 试
// let objport = "api/ecshop-server";
// 测试服务器
// let objport = "/ecshop-server";

let objport = requestPort();

axios.interceptors.request.use((config) => {
    if (config.method === 'post') {
        if (config.url == objport + "/system/testAccessSign") {
            async function useropen() {
                var data = config.data
                config.data = JSON.stringify(data);
            }
            useropen();
        } else if (config.url == objport + "/system/innerAccessSign") {
            async function useropen() {
                var data = config.data
                config.data = JSON.stringify(data);
            }
            useropen();
        } else if (config.url == objport + "/system/checkToken.do") {
            async function useropen() {
                var data = config.data
                config.data = JSON.stringify(data);
            }
            useropen();
        } else {
            let map = {};
            map.data = JSON.stringify(config.data)
            var signs = "data=" + JSON.stringify(config.data) + "&stmb=" + btime;
            var signmd5 = md5String(signs).toString()
            let _data = Object.assign(map, { sign: signmd5.toUpperCase(), token: localStorage.getItem("token"), version: "02", stmb: btime });
            config.data = qs.stringify(_data);
        }
    }
    return config;
})

export function fetchs(options) {
    options = options || {};
    return new Promise((resolve, reject) => {
        axios({
            url: options.url,
            method: options.method || 'get',
            //baseURL: options.baseURL || Config.baseUrl,
            baseURL: '',
            headers: {
                'X-Requested-With': 'XMLHttpRequest',
                'Access-Control-Allow-Origin': '*',
                "Access-Control-Allow-Methods": "POST,GET",
                'Access-Control-Allow-Credentials': true,
                'Access-Control-Expose-Headers': 'FooBar',
                'Content-Type': 'application/json',
                'Accept': 'application/json',
            },
            //`params`选项是要随请求一起发送的请求参数----一般链接在URL后面
            //他的类型必须是一个纯对象或者是URLSearchParams对象
            params: options.data,
            // //`paramsSerializer`是一个可选的函数，起作用是让参数（params）序列化
            // //例如(https://www.npmjs.com/package/qs,http://.jquery.com/jquery.param)
            paramsSerializer: function (params) {

            },
            //`data`选项是作为一个请求体而需要被发送的数据
            //该选项只适用于方法：`put/post/patch`
            //当没有设置`transformRequest`选项时dada必须是以下几种类型之一
            //string/plain/object/ArrayBuffer/ArrayBufferView/URLSearchParams
            //仅仅浏览器：FormData/File/Bold
            //仅node:Stream
            data: options.data,

            //`timeout`选项定义了请求发出的延迟毫秒数
            //如果请求花费的时间超过延迟的时间，那么请求会被终止

            // timeout: options.timeout || 30000,
            // //`withCredentails`选项表明了是否是跨域请求

            withCredentials: true, //default
            //`adapter`适配器选项允许自定义处理请求，这会使得测试变得方便
            //返回一个promise,并提供验证返回
            // adapter: function(config){
            // /*..........*/
            // },
            auth: {
                username: "fruitday",
                password: "fruitday"
            },
            dataType: 'json',
            timeout: 20000,
            responseType: 'json', //default
            //`xsrfCookieName`是要用作 xsrf 令牌的值的cookie的名称
            xsrfCookieName: 'XSRF-TOKEN', //default
            // `xsrfHeaderName`是携带xsrf令牌值的http头的名称
            xsrfHeaderName: 'X-XSRF-TOKEN', //default
            //`onUploadProgress`上传进度事件
            onUploadProgress: function (progressEvent) {
                // console.log(progressEvent)
            },
            //下载进度的事件
            onDownloadProgress: function (progressEvent) {
                // console.log(progressEvent)
            },
            //相应内容的最大值
            maxContentLength: 2000,
            //`validateStatus`定义了是否根据http相应状态码，来resolve或者reject promise
            //如果`validateStatus`返回true(或者设置为`null`或者`undefined`),那么promise的状态将会是resolved,否则其状态就是rejected
            validateStatus: function (status) {
                return status >= 200 && status < 300; //default
            },
            // //`maxRedirects`定义了在nodejs中重定向的最大数量
            maxRedirects: 5, //default
            // //`httpAgent/httpsAgent`定义了当发送http/https请求要用到的自定义代理
            // //keeyAlive在选项中没有被默认激活
            // httpAgent: new http.Agent({keeyAlive:true}),
            // httpsAgent: new https.Agent({keeyAlive:true}),
            //proxy定义了主机名字和端口号，
            //`auth`表明http基本认证应该与proxy代理链接，并提供证书
            //这将会设置一个`Proxy-Authorization` header,并且会覆盖掉已经存在的`Proxy-Authorization`  header
            proxy: {
                host: '127.0.0.1',
                port: 8080,
                auth: {
                    username: 'skda',
                    password: 'radsd'
                }
            }
        }).then(response => {
            resolve(response.data)
        }).catch(error => {
            reject(error)
        })
    })
}
export function fetch(options) {
    options = options || {};
    return new Promise((resolve, reject) => {
        axios({
            url: options.url,
            method: options.method || 'get',
            //baseURL: options.baseURL || Config.baseUrl,
            baseURL: '',
            headers: {
                'X-Requested-With': 'XMLHttpRequest',
                'Access-Control-Allow-Origin': '*',
                "Access-Control-Allow-Methods": "POST,GET",
                'Access-Control-Allow-Credentials': true,
                'Access-Control-Expose-Headers': 'FooBar',
                'Content-Type': 'application/x-www-form-urlencoded',
                'Accept': 'application/json',
            },
            //`params`选项是要随请求一起发送的请求参数----一般链接在URL后面
            //他的类型必须是一个纯对象或者是URLSearchParams对象
            params: options.data,
            // //`paramsSerializer`是一个可选的函数，起作用是让参数（params）序列化
            // //例如(https://www.npmjs.com/package/qs,http://.jquery.com/jquery.param)
            paramsSerializer: function (params) {

            },
            //`data`选项是作为一个请求体而需要被发送的数据
            //该选项只适用于方法：`put/post/patch`
            //当没有设置`transformRequest`选项时dada必须是以下几种类型之一
            //string/plain/object/ArrayBuffer/ArrayBufferView/URLSearchParams
            //仅仅浏览器：FormData/File/Bold
            //仅node:Stream
            data: options.data,

            //`timeout`选项定义了请求发出的延迟毫秒数
            //如果请求花费的时间超过延迟的时间，那么请求会被终止

            // timeout: options.timeout || 30000,
            // //`withCredentails`选项表明了是否是跨域请求

            withCredentials: true, //default
            //`adapter`适配器选项允许自定义处理请求，这会使得测试变得方便
            //返回一个promise,并提供验证返回
            // adapter: function(config){
            // /*..........*/
            // },
            auth: {
                username: "fruitday",
                password: "fruitday"
            },
            dataType: 'json',
            timeout: 20000,
            responseType: 'json', //default
            //`xsrfCookieName`是要用作 xsrf 令牌的值的cookie的名称
            xsrfCookieName: 'XSRF-TOKEN', //default
            // `xsrfHeaderName`是携带xsrf令牌值的http头的名称
            xsrfHeaderName: 'X-XSRF-TOKEN', //default
            //`onUploadProgress`上传进度事件
            onUploadProgress: function (progressEvent) {
                // console.log(progressEvent)
            },
            //下载进度的事件
            onDownloadProgress: function (progressEvent) {
                // console.log(progressEvent)
            },
            //相应内容的最大值
            maxContentLength: 2000,
            //`validateStatus`定义了是否根据http相应状态码，来resolve或者reject promise
            //如果`validateStatus`返回true(或者设置为`null`或者`undefined`),那么promise的状态将会是resolved,否则其状态就是rejected
            validateStatus: function (status) {
                return status >= 200 && status < 300; //default
            },
            // //`maxRedirects`定义了在nodejs中重定向的最大数量
            maxRedirects: 5, //default
            // //`httpAgent/httpsAgent`定义了当发送http/https请求要用到的自定义代理
            // //keeyAlive在选项中没有被默认激活
            // httpAgent: new http.Agent({keeyAlive:true}),
            // httpsAgent: new https.Agent({keeyAlive:true}),
            //proxy定义了主机名字和端口号，
            //`auth`表明http基本认证应该与proxy代理链接，并提供证书
            //这将会设置一个`Proxy-Authorization` header,并且会覆盖掉已经存在的`Proxy-Authorization`  header
            proxy: {
                host: '127.0.0.1',
                port: 8080,
                auth: {
                    username: 'skda',
                    password: 'radsd'
                }
            }
        }).then(response => {
            resolve(response.data)
            if (response.data.rspCode == "1111") {
                MessageBox('', response.data.rspMsg || '系统繁忙,请稍后重试');
            } else if (response.data.rspCode == "1999") {
                localStorage.removeItem("token");
                async function timeout() {
                    // await MessageBox('', '会话超时');
                    WeixinJSBridge.call('closeWindow');

                }
                timeout();
            } else if (response.data.rspCode == "1998") {
                MessageBox('', '缺少参数,请稍后重试');
            }
        }).catch(error => {
            reject(error)
        })
    })
}
export function fetchss(options) {
    options = options || {};
    return new Promise((resolve, reject) => {
        axios({
            url: options.url,
            method: options.method || 'get',
            //baseURL: options.baseURL || Config.baseUrl,
            baseURL: '',
            headers: {
                'X-Requested-With': 'XMLHttpRequest',
                'Access-Control-Allow-Origin': '*',
                "Access-Control-Allow-Methods": "POST,GET",
                'Access-Control-Allow-Credentials': true,
                'Access-Control-Expose-Headers': 'FooBar',
                'Content-Type': 'application/x-www-form-urlencoded',
                'Accept': 'application/json',
            },
            //`params`选项是要随请求一起发送的请求参数----一般链接在URL后面
            //他的类型必须是一个纯对象或者是URLSearchParams对象
            params: options.data,
            // //`paramsSerializer`是一个可选的函数，起作用是让参数（params）序列化
            // //例如(https://www.npmjs.com/package/qs,http://.jquery.com/jquery.param)
            paramsSerializer: function (params) {

            },
            //`data`选项是作为一个请求体而需要被发送的数据
            //该选项只适用于方法：`put/post/patch`
            //当没有设置`transformRequest`选项时dada必须是以下几种类型之一
            //string/plain/object/ArrayBuffer/ArrayBufferView/URLSearchParams
            //仅仅浏览器：FormData/File/Bold
            //仅node:Stream
            data: options.data,

            //`timeout`选项定义了请求发出的延迟毫秒数
            //如果请求花费的时间超过延迟的时间，那么请求会被终止

            // timeout: options.timeout || 30000,
            // //`withCredentails`选项表明了是否是跨域请求

            withCredentials: true, //default
            //`adapter`适配器选项允许自定义处理请求，这会使得测试变得方便
            //返回一个promise,并提供验证返回
            // adapter: function(config){
            // /*..........*/
            // },
            auth: {
                username: "fruitday",
                password: "fruitday"
            },
            dataType: 'json',
            timeout: 20000,
            responseType: 'json', //default
            //`xsrfCookieName`是要用作 xsrf 令牌的值的cookie的名称
            xsrfCookieName: 'XSRF-TOKEN', //default
            // `xsrfHeaderName`是携带xsrf令牌值的http头的名称
            xsrfHeaderName: 'X-XSRF-TOKEN', //default
            //`onUploadProgress`上传进度事件
            onUploadProgress: function (progressEvent) {
                // console.log(progressEvent)
            },
            //下载进度的事件
            onDownloadProgress: function (progressEvent) {
                // console.log(progressEvent)
            },
            //相应内容的最大值
            maxContentLength: 2000,
            //`validateStatus`定义了是否根据http相应状态码，来resolve或者reject promise
            //如果`validateStatus`返回true(或者设置为`null`或者`undefined`),那么promise的状态将会是resolved,否则其状态就是rejected
            validateStatus: function (status) {
                return status >= 200 && status < 300; //default
            },
            // //`maxRedirects`定义了在nodejs中重定向的最大数量
            maxRedirects: 5, //default
            // //`httpAgent/httpsAgent`定义了当发送http/https请求要用到的自定义代理
            // //keeyAlive在选项中没有被默认激活
            // httpAgent: new http.Agent({keeyAlive:true}),
            // httpsAgent: new https.Agent({keeyAlive:true}),
            //proxy定义了主机名字和端口号，
            //`auth`表明http基本认证应该与proxy代理链接，并提供证书
            //这将会设置一个`Proxy-Authorization` header,并且会覆盖掉已经存在的`Proxy-Authorization`  header
            proxy: {
                host: '127.0.0.1',
                port: 8080,
                auth: {
                    username: 'skda',
                    password: 'radsd'
                }
            }
        }).then(response => {
            resolve(response.data)
            if (response.data.rspCode == "1111") {
                MessageBox('', response.data.rspMsg || '系统繁忙,请稍后重试');
            } else if (response.data.rspCode == "1999") {
                localStorage.removeItem("token");
                async function timeout() {
                    // await MessageBox('', '会话超时');
                    WeixinJSBridge.call('closeWindow');

                }
                timeout();
            } else if (response.data.rspCode == "1998") {
                MessageBox('', '缺少参数,请稍后重试');
            }
        }).catch(error => {
            reject(error)
        })
    })
}
export function getUrlParam(name) {
    // 从url上获取信息
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象  
    var r = window.location.search.substr(1).match(reg);  //匹配目标参数  
    if (r != null) return unescape(r[2]); return null; //返回参数值  
}
export function system(data) {
    //模拟登陆 获取token 颜色值
    let params = {
        method: 'post',
        url: objport + "/system/testAccessSign",
        data
    }
    return fetchs(params);
}
export function innerAccessSign(data) {
    //只传入InnerNO 和 userId
    let params = {
        method: 'post',
        url: objport + "/system/innerAccessSign",
        data
    }
    return fetchs(params);
}
export function CheckToken(data) {
    //5.1.21.汇卡宝token校验
    let params = {
        method: 'post',
        url: objport + "/system/checkToken.do",
        data
    }
    return fetchs(params);
}
export function getHomeshuimg(data) {
    //轮播图5.1.1
    let params = {
        method: 'post',
        url: objport + '/advert/queryInstitutionBanner',
        data
    }
    return fetch(params);
}

export function getHomeEightCard(data) {
    //菜品类别5.1.2
    let params = {
        method: 'post',
        url: objport + '/category/queryCategoryList',
        data
    }
    return fetch(params);
}

export function querySecondLevelList(data) {
    //商品二级类别
    let params = {
        method: 'post',
        url: objport + '/category/querySecondLevelList',
        data
    }
    return fetch(params);
}
export function getHomeBottomlist(data) {
    //首页底部热门商品 5.1.3
    let params = {
        method: 'post',
        url: objport + '/product/queryHotProductList',
        data
    }
    return fetch(params);
}
export function getproductlist(data) {
    //商品列表查询5.1.4
    let params = {
        method: 'post',
        url: objport + '/product/queryProductList',
        data
    }
    return fetch(params);
}

export function getProductDetails(data) {
    //商品详情查询5.1.5
    let params = {
        method: 'post',
        url: objport + '/product/queryProductDetails',
        data
    }
    return fetch(params);
}

export function getProvince(data) {
    //获取省份
    let params = {
        method: 'post',
        url: objport + '/address/ getProvince',
        data
    }
    return fetch(params);
}

export function getCity(data) {
    //获取市份
    let params = {
        method: 'post',
        url: objport + '/address/ getCity',
        data
    }
    return fetch(params);
}

export function getArea(data) {
    //获取区份
    let params = {
        method: 'post',
        url: objport + '/address/ getArea',
        data
    }
    return fetch(params);
}

export function addAddress(data) {
    //添加
    let params = {
        method: 'post',
        url: objport + '/address/addAddress',
        data
    }
    return fetch(params);
}

export function getAddressList(data) {
    //获取地址列表
    let params = {
        method: 'post',
        url: objport + '/address/queryAddressList',
        data
    }
    return fetch(params);
}

export function deleteAddressById(data) {
    //删除地址
    let params = {
        method: 'post',
        url: objport + '/address/deleteAddressById',
        data
    }
    return fetch(params);
}

export function queryDetailsAddress(data) {
    //地址编辑
    let params = {
        method: 'post',
        url: objport + '/address/queryDetailsAddress',
        data
    }
    return fetch(params);
}

export function editDetailsAddress(data) {
    //地址编辑提交
    let params = {
        method: 'post',
        url: objport + '/address/editDetailsAddress',
        data
    }
    return fetch(params);
}

export function queryOrderList(data) {
    //订单列表
    let params = {
        method: 'post',
        url: objport + '/order/queryOrderList',
        data
    }
    return fetch(params);
}
export function confirmReceipt(data) {
    //确认付款
    let params = {
        method: 'post',
        url: objport + '/order/confirmReceipt',
        data
    }
    return fetch(params);
}

export function createOrder(data) {
    //5.1.17.订单下单
    let params = {
        method: 'post',
        url: objport + '/order/createOrder',
        data
    }
    return fetch(params);
}

export function queryOrderDetails(data) {
    //实物订单详情
    let params = {
        method: 'post',
        url: objport + '/order/queryOrderDetails',
        data
    }
    return fetch(params);
}

export function integralExchangeProduct(data) {
    //5.1.18.订单支付
    let params = {
        method: 'post',
        url: objport + '/order/integralExchangeProduct',
        data
    }
    return fetch(params);
}
export function hkbOrderpay(data) {
    //5.1.21.汇卡宝支付
    let params = {
        method: 'post',
        url: objport + '/order/hkbOrderpay',
        data
    }
    return fetch(params);
}


export function queryUserIntergral(data) {
    //积分查询
    let params = {
        method: 'post',
        url: objport + '/user/queryUserIntegral',
        data
    }
    return fetch(params);
}

export function queryUserVoucherDetails(data) {
    //积分查询
    let params = {
        method: 'post',
        url: objport + '/order/queryUserVoucherDetails',
        data
    }
    return fetch(params);
}

export function createShoppingOrders(data) {
    //5.1.17.订单下单
    let params = {
        method: 'post',
        url: objport + '/order/createShoppingOrders',
        data
    }
    return fetch(params);
}

export function splitOrder(data) {
    let params = {
        method: 'post',
        url: objport + '/order/splitOrder',
        data
    }
    return fetch(params);
}
//运费，总金额，积分
export function shoppingOrders(data) {
    let params = {
        method: 'post',
        url: objport + '/order/shoppingOrders',
        data
    }
    return fetch(params);
}

//规格查询
export function queryProductSpec(data) {
    let params = {
        method: 'post',
        url: objport + '/product/queryProductSpec',
        data
    }
    return fetch(params);
}

//用户操作购物车，更新数组
export function getShopping(data) {
    let params = {
        method: 'post',
        url: objport + '/shoppingCart/getShoppingCart',
        data
    }
    return fetch(params);
}

//加入购物车
export function Shopset(data) {
    let params = {
        method: 'post',
        url: objport + "/shoppingCart/setShoppingCart",
        data
    }
    return fetch(params);
}

//所选规格不同，获取相应价格
export function queryProductSpecByPrice(data) {
    let params = {
        method: 'post',
        url: objport + '/product/queryProductSpecByPrice',
        data
    }
    return fetch(params);
}

//购物车删除
export function deletShop(data) {
    let params = {
        method: 'post',
        url: objport + '/shoppingCart/updateShoppingCart',
        data
    }
    return fetch(params);
}


//卡券列表
export function queryMyShareList(data) {
    let params = {
        method: 'post',
        url: objport + '/share/queryMyShareList',
        data
    }
    return fetch(params);
}


//绑卡要素填写
export function tiedCard(data) {
    let params = {
        method: 'post',
        url: objport + '/user/tiedCard',
        data
    }
    return fetch(params);
}
//绑卡验证码填写
export function synCard(data) {
    let params = {
        method: 'post',
        url: objport + '/user/synCard',
        data
    }
    return fetch(params);
}
//钱包
export function getUserAmt(data) {
    let params = {
        method: 'post',
        url: objport + '/user/getUserAmt',
        data
    }
    return fetch(params);
}

//单商品券
export function myProductCoupon(data) {
    let params = {
        method: 'post',
        url: objport + '/coupon/myProductCoupon',
        data
    }
    return fetch(params);
}

//领券
export function getCoupon(data) {
    let params = {
        method: 'post',
        url: objport + '/coupon/getCoupon',
        data
    }
    return fetch(params);
}

//提现
export function userWithdrawal(data) {
    let params = {
        method: 'post',
        url: objport + '/share/userWithdrawal',
        data
    }
    return fetch(params);
}

//绑定手机号
export function bindUserInfoPhone(data) {
    let params = {
        method: 'post',
        url: objport + '/share/bindUserInfoPhone',
        data
    }
    return fetch(params);
}

//获取微信签名
export function getSignature(data) {
    let params = {
        method: 'get',
        url: objport + '/account/getsdk',
        data
    }
    return fetch(params);
}

//点击分享，获取code 
export function queryShareCoupon(data) {
    let params = {
        method: 'post',
        url: objport + '/share/queryShareCoupon',
        data
    }
    return fetch(params);
}

//获取code后，二维码 
export function shareQrCodeLink(data) {
    let params = {
        method: 'post',
        url: objport + '/share/shareQrCodeLinkBase',
        data
    }
    return fetchss(params);
}

//微信分享请求返回链接
export function shareCouponLink(data) {
    let params = {
        method: 'post',
        url: objport + '/share/shareCouponLink',
        data
    }
    return fetchss(params);
}

//显示优惠券信息接口
export function findShareCouponInfo(data) {
    let params = {
        method: 'post',
        url: objport + '/share/findShareCouponInfo',
        data
    }
    return fetchss(params);
}

//优惠券领取接口
export function scanQRcode(data) {
    let params = {
        method: 'post',
        url: objport + '/share/scanQRcode',
        data
    }
    return fetchss(params);
}

//查询商户券列表
export function queryMchtCouponList(data) {
    let params = {
        method: 'post',
        url: objport + '/mchtCopon/queryMchtCouponList',
        data
    }
    return fetchss(params);
}

//提交批量申请
export function commitCouponApply(data) {
    let params = {
        method: 'post',
        url: objport + '/coupon/commitCouponApply',
        data
    }
    return fetchss(params);
}

//批量申请列表
export function queryCouponApplyList(data) {
    let params = {
        method: 'post',
        url: objport + '/coupon/queryCouponApplyList',
        data
    }
    return fetchss(params);
}

//批量申请列表
export function queryCouponApplyDetail(data) {
    let params = {
        method: 'post',
        url: objport + '/coupon/queryCouponApplyDetail',
        data
    }
    return fetchss(params);
}

//编辑批量申请
export function editCouponApply(data) {
    let params = {
        method: 'post',
        url: objport + '/coupon/editCouponApply',
        data
    }
    return fetchss(params);
}

//买单5.1.34.查询商品的我的优惠券
export function myProductVouchers(data) {
    let params = {
        method: 'post',
        url: objport + '/order/myProductVouchers',
        data
    }
    return fetchss(params);
}
//直接购买，点击选择优惠券后；返回具体金额
export function sureCreateOrders(data) {
    let params = {
        method: 'post',
        url: objport + '/order/sureCreateOrders',
        data
    }
    return fetchss(params);
}
//购物车，点击选择优惠券后；返回具体金额
export function orderCoupon(data) {
    let params = {
        method: 'post',
        url: objport + '/order/orderCoupon',
        data
    }
    return fetchss(params);
}
//批量分享
export function queryShareCouponMore(data) {
    let params = {
        method: 'post',
        url: objport + '/share/queryShareCouponMore',
        data
    }
    return fetchss(params);
}

//取消订单
export function orderCancel(data) {
    let params = {
        method: 'post',
        url: objport + '/order/orderCancel',
        data
    }
    return fetchss(params);
}
//判断手机验证
export function isRegister(data) {
    let params = {
        method: 'post',
        url: objport + '/user/isRegister',
        data
    }
    return fetchss(params);
}

//判断账户等级
export function getUserLevel(data) {
    let params = {
        method: 'post',
        url: objport + '/user/getUserLevelValue',
        data
    }
    return fetchss(params);
}

//用户设置时，获取用户信息接口
export function getUserInfo(data) {
    let params = {
        method: 'post',
        url: objport + '/user/getUserInfo',
        data
    }
    return fetchss(params);
}

//修改用户姓名或者昵称
export function updateUserInfo(data) {
    let params = {
        method: 'post',
        url: objport + '/user/updateUserNameNickName',
        data
    }
    return fetchss(params);
}

//获取用户成长值详情
export function getLevelDetail(data) {
    let params = {
        method: 'post',
        url: objport + '/user/queryUserLevelValueDetailListPage',
        data
    }
    return fetchss(params);
}

//获取个人优惠券总数
export function queryCouponUsableCount(data){
    let params = {
        method:'post',
        url: objport +'/share/queryCouponUsableCount',
        data
    }
    return fetchss(params);
}

// user/getUserBankCardList 获取银行卡列表
export function getBankCardList(data){
    let params = {
        method:'post',
        url: objport +'/user/getUserBankCardList',
        data
    }
    return fetchss(params);
}
// 首页模块信息查询
export function queryModuleList(data){
    let params = {
        method:'post',
        url: objport + '/module/queryModuleList',
        data
    }
    return fetchss(params)
}

//短信验证接口
export function bindPhoneSendSms(data){
    let params = {
        method:'post',
        url: objport + '/sms/bindPhoneSendSms',
        data
    }
    return fetchss(params);
}
//用户出示核销优惠券功能接口
export function queryVerificationCoupon(data){
    let params = {
        method:'post',
        url:objport + '/verification/queryVerificationCoupon',
        data
    }
    return fetchss(params);
}
//店员核销优惠券接口
export function cancelCoupon(data){
    let params = {
        method:'post',
        url:objport + '/coupon/cancelCoupon',
        data
    }
    return fetchss(params);
}
//核销优惠券信息查询
export function hexiaoCoupon(data){
    let params = {
        method:'post',
        url:objport + '/verification/verificationCouponInfoDetail',
        data
    }
    return fetchss(params);
}
// 店铺列表接口
export function queryStoreList(data){
    let params = {
        method:'post',
        url: objport + '/store/queryStoreInfoList',
        data
    }
    return fetchss(params)
}

// 店铺列表接口
export function applyStoreUser(data){
    let params = {
        method:'post',
        url: objport + '/store/applyStoreUserInfo',
        data
    }
    return fetchss(params)
}
//查询用户有没有关注(不需要参数的版本)
export function isUserSubscribe(data){
    let params = {
        method:'post',
        url: objport + '/user/isUserSubscribe',
        data
    }
    return fetchss(params)
}
//moonCakeLink 查询用户验证
export function moonCakeLink(data){
    let params = {
        method:'post',
        url: objport + '/verification/moonCakeLink',
        data
    }
    return fetchss(params)
}
//store/storeWechatLink 核销页面跳转验证
export function storeWechatLink(data){
    let params = {
        method:'post',
        url: objport + '/store/storeWechatLink',
    }
    return fetchss(params)
}